#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int value = QInputDialog::getInt(this, "整数输入框", "输入一个整数: ");
    qDebug() << value;
}

void MainWindow::on_pushButton_2_clicked()
{
    double value = QInputDialog::getDouble(this, "浮点数输入框", "输入一个浮点数: ");
    qDebug() << value;
}

void MainWindow::on_pushButton_3_clicked()
{
    QStringList items;
    items.push_back("张三");
    items.push_back("李四");
    items.push_back("王五");
    items.push_back("赵六");
    QString item = QInputDialog::getItem(this, "条目输入框", "输入一个条目: ", items);
    qDebug() << item;
}
